﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Admin.Master" AutoEventWireup="true" CodeBehind="ServiceDetail.aspx.cs" Inherits="MobiMap.Admin.ServiceDetail" Title="Service Detail" %>

<%@ Register TagPrefix="UserControl"  TagName="PlaceUC"  Src="~/Admin/placeUC.ascx" %>

<asp:Content ID="ctHead" ContentPlaceHolderID="head" runat="server">
    <title>Service Detail</title>
    <script type="text/javascript">
        function ConfirmDelete()
        {
            var confirmMessage = document.getElementById('<%=hddConfirm.ClientID %>').value;
            var answer = confirm(confirmMessage);
            if(answer == true)
                return true;
                
            return false;
        }
        
        function ShowHideDetailEdit(display1, display2)
        {
            document.getElementById('divDetail').style.display = display1;
            document.getElementById('divEdit').style.display = display2;
            return false;
        }
        
        function checkPlaceInfo()
        {
            checkFullName();
            checkAddress();
            checkLatLong();
            
            if(errorFullName == true || errorAddress == true || errorLatLong == true)
                return false;
                
            return false;
        }   
        
        function cancelEdit()
        {
            ShowHideDetailEdit("block", "none")
            window.location = "ServiceDetail.aspx?ID=" + document.getElementById('<%=hiddenID.ClientID %>').value;
            return false;
        }
        
    </script>
</asp:Content>
<asp:Content ID="ctMain" ContentPlaceHolderID="mainArea" runat="server">
    <div id="divDetail">
        <div class="divPicture">
            <img id="imgPic" src="" width="128" height="128" alt="abc" runat="server" style="border: solid 1px Silver;"/>
        </div>
        <div class="divPlaceInfo">
            <b><asp:Label ID="lbName" runat="server" Text=""></asp:Label></b><br />
            <asp:Label ID="lbPlaceType" runat="server" Text=""></asp:Label><br />
            <asp:Label ID="lbAddress" runat="server" Text=""></asp:Label><br />
            <asp:Label ID="lbPhone" runat="server" Text=""></asp:Label><br />
            <asp:Label ID="lbWebsite" runat="server" Text=""></asp:Label><br />
            <asp:Label ID="lbDescription" runat="server" Text=""></asp:Label> 
            <asp:HiddenField ID="hiddenID" runat="server"/>
            <br /><br /><br />
            <hr style="width: 100%; height:1px; color:#3B6E22;"/>
            <asp:Button ID="btnEdit" CssClass="button" runat="server" 
                OnClientClick="return ShowHideDetailEdit('none', 'block');" Text="Sửa"/>
            <asp:Button ID="btnDelete" CssClass="button" runat="server" 
                OnClientClick="return ConfirmDelete()" Text="Xóa" onclick="btnDelete_Click" />       
        </div><br />
    </div>


    <div align="center" id="divEdit" class="placeUC_wrapper">
        <UserControl:PlaceUC ID="placeUC" runat="server" />        
        <asp:Button ID="btnSave" CssClass="button" runat="server" OnClientClick="return checkPlaceInfo();" Text="Lưu" onclick="btnSave_Click"/>
        <asp:Button ID="btnCancel" CssClass="button" runat="server" OnClientClick="return cancelEdit();" Text="Thoát"/>
    </div>


    <asp:HiddenField ID="hddConfirm" runat="server" />
</asp:Content>
